<?php
class stFacebookPage_model extends stmodel_2_1{

    public function __construct($config) {
        parent::__construct ( $config );
        $this->setTableName('st_likepluginfbpagelist');
        $this->setPrimaryKey('pageid');
    }
    public function get_pagelist($id = ''){
        if(empty($id)){
            $id = get_current_user_id();
        }        
        $result = $this->get_results("SELECT * FROM st_likepluginfbpagelist WHERE user_id = ".$id);
        return $result;
    }
    public function get_fan($id){
    	$user = json_decode(file_get_contents("http://graph.facebook.com/".$id));
    	return $user->likes;
    }

    public function getFanPageDetail($id = ''){
        
        $result = $this->get_results("SELECT * FROM st_likepluginfbpagelist WHERE pageid = ".$id);
        return $result;
    }


}